#coding=gbk
if __name__ == '__main__':
    print "line filter"
    folder="c:/log/"
    key = 'if/guangyu'
    in_filename = r'C:\log\PIInterfaceService.log'
    out_filename = 'c:/new.txt'
    in_file = open(in_filename, 'r')
    out_file = open(out_filename, 'w')
    for line in in_file:
        if line.find(key)!=-1 :
            print line,
            out_file.write(line)
    
    print 'end'

            